<?php

class requestmodule_config {
	function form($object) {
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();

		$form = new form();
		if (!isset($object->id)) {
			$object->intro_message="";
			$object->not_login_message="";
			$object->submit_success_message="";
			$object->mail_subject="";
			$object->mail_content="";
			$object->calendar_src="";
			$object->calendar_catid=0;
		} else {
			$form->meta('id',$object->id);
		}
		$form->register('intro_message','Intro Message',new htmleditorcontrol($object->intro_message));
		$form->register('not_login_message','Message when for guest',new htmleditorcontrol($object->not_login_message));
		$form->register('submit_success_message','Message when submit success',new htmleditorcontrol($object->submit_success_message));
		
		//
		$form->register('mail_subject','Mail subject, when register successful',new textcontrol($object->mail_subject,60,false,400,"",true));
		$form->register('mail_content','Mail content, when register successful',new htmleditorcontrol($object->mail_content));
		$form->register('',null,new htmlcontrol("<p>You can use <b>%name%</b> for Name of request person, <b>%email%</b> for request email, <b>%phone%</b> for Phone number, <b>%from_date%</b> for date of request begin, <b>%time_length%</b> hire time length, <b>%note%</b> for Other comment field, <b>%post_date%</b> for request date, <b>%ip%</b> for IP Addreess, <b>%id%</b> for ID of request, <b>%price%</b> for price, <b>%cat_name%</b> for category name (room name), <b>%status%</b> for status of request</p>"));
		
		$form->register('calendar_src','Calendar source location',new textcontrol($object->calendar_src,60,false,400,"",true));
		
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function update($values,$object) {
		$object->submit_success_message=$values['submit_success_message'];
		$object->not_login_message=$values['not_login_message'];
		$object->intro_message=$values['intro_message'];
		$object->mail_subject=$values['mail_subject'];
		$object->mail_content=$values['mail_content'];
		$object->calendar_src=$values['calendar_src'];
		return $object;
	}
}

?>